<template>
  <div id="noticeDetails" class="h5-app-container content-container">
    <div class="notice-body">
      <div class="title">{{ noticeDetails.noticeTitle }}</div>
      <div class="subDesc">
        {{ noticeDetails.createdBy | optionUserFormat }}  {{ noticeDetails.gmtCreated | formatDate("yyyy-MM-dd hh:mm") }}
      </div>
      <div class="content" v-html="noticeDetails.noticeContent" />
      <div v-if="noticeDetails.noticeFile">
        <div>附件：共<span class="color-primary">{{ noticeDetails.noticeFile.split(',').length }}</span>个附件</div>
        <FileItem :files="noticeDetails.noticeFile.split(',')" />
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      noticeDetails: {}
    }
  },
  computed: {
  },
  created() {
    this.loadNoticeDetails()
  },
  destroyed() {
  },
  methods: {
    loadNoticeDetails() {
      if (!this.$route.params.id) {
        this.$modal.msgWarning('无效的参数')
        return
      }
      this.$store.dispatch('getNoticeById', this.$route.params.id).then(res => {
        if (!res) {
          return
        }
        this.noticeDetails = res
      }).catch((_) => {})
    }
  }
}
</script>
<style scoped lang="scss">
  #noticeDetails{
  }

  </style>

